import {ApplicationConfig, importProvidersFrom} from '@angular/core';
import { provideRouter } from '@angular/router';

import { routes } from './app.routes';
import { provideClientHydration } from '@angular/platform-browser';
import {OAuthModule, provideOAuthClient} from "angular-oauth2-oidc";
import {HttpClientModule, provideHttpClient} from "@angular/common/http";
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import {provideEnvironmentNgxMask} from "ngx-mask";

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    provideClientHydration(),
    provideOAuthClient(),
    provideHttpClient(),
    provideEnvironmentNgxMask(),
    provideAnimationsAsync('noop'),
    importProvidersFrom(HttpClientModule),
    importProvidersFrom(OAuthModule.forRoot({
      resourceServer: {
        allowedUrls: ['http://localhost:8189/api/v1/auth',
          'http://localhost:8189/api/v1/create-lawyer',
          'http://localhost:8189/api/v1/save_image',
        'http://localhost:8189/api/v1/emergency',
        'http://localhost:8189/api/v1/test-lawyer'
        ],
        sendAccessToken: true
      }
    }))
  ]
};
